home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Codigo / Imágenes y mapas de bits / ImageReflection / ImageReflection.cs next >
Encoding:
Text File  |  2002-05-06  |  999 b   |  33 lines

  1. //----------------------------------------------
  2. // ImageReflection.cs ⌐ 2001 by Charles Petzold
  3. //----------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class ImageReflection: PrintableForm
  9. {
  10.      Image image;
  11.  
  12.      public new static void Main()
  13.      {
  14.           Application.Run(new ImageReflection());
  15.      }
  16.      public ImageReflection()
  17.      {
  18.           Text = "Imagen reflejada";
  19.  
  20.           image = Image.FromFile("..\\..\\..\\Apollo11FullColor.jpg");
  21.      }
  22.      protected override void DoPage(Graphics grfx, Color clr, int cx, int cy)
  23.      {
  24.           int cxImage = image.Width;
  25.           int cyImage = image.Height;
  26.  
  27.           grfx.DrawImage(image, cx / 2, cy / 2,  cxImage,  cyImage);
  28.           grfx.DrawImage(image, cx / 2, cy / 2, -cxImage,  cyImage);
  29.           grfx.DrawImage(image, cx / 2, cy / 2,  cxImage, -cyImage);
  30.           grfx.DrawImage(image, cx / 2, cy / 2, -cxImage, -cyImage);
  31.      }
  32. }
  33.